Xbasic

WITH ... END WITH

Syntax

WITH Parent_Dot_Variable as P statements END WITH WITH Variable_Name_Space as P statements END WITH

Arguments

Parent_Dot_Variable

The name of a dot variable.

Variable_Name_Space

A variable name space. This can be defined in several ways: GLOBAL_VARIABLES() returns a pointer to the global variables LOCAL_VARIABLES() returns a pointer to local variables: layoutname.variables() returns a pointer to the variables local to layoutname

Description

Allows you to manipulate and define variables in a specified variable name space, or for a specified "dot" variable.

Discussion

WITH ... END WITH allows you to manipulate and define variables in a specified variable name space, or for a specified "dot" variable.

See Getting a Pointer to Variables in a Different name-space and Dot Variables for more information. See also, GLOBAL_VARIABLES(), LOCAL_VARIABLES().

Example

Set the default name space to global_variables(), then define several global variables.

WITH global_variables()
    Firstname = "Jonathan"
    Lastname = "Swift"
    Address = "2 Bigelow St."
    City = "Cambridge"
    State = "MA"
    Zip = "02139"
END WITH

Set the default name space to local variables on the Customer form, then set the value of several local variables on the Customer form.

WITH :customer.variables()
    Start_Date = {1/1/99}
    End_Date = {1/31/99}
END WITH

Set the default name space to the customer dot variable.

WITH customer
    firstname = "John"
    lastname = "Smith"
END WITH
trace.writeln(customer.firstname)
trace.writeln(customer.lastname)

See Also